﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MissingOrdersReport.aspx.cs" Inherits="MLY.Reports.SCCoverReports.MissingOrdersReport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Missing orders report</title>
    <style type="text/css">
        .TitleStyle
        {
            font-family:Arial Sans-Serif David;
            font-size:14px;
            font-weight:bold;
            color:Black;
        }
        .InerTextStyle
        {
            font-family:Arial Sans-Serif David;
            font-size:12px;
            color:Black;
        }
        
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="InerTextStyle">
        <asp:ToolkitScriptManager ID="ScriptManager1" runat="server"></asp:ToolkitScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <Triggers>
            <asp:PostBackTrigger ControlID="ExportImageButton" />
        </Triggers>
        <ContentTemplate>   
            <asp:Label ID="PageTitleLabel" runat="server" CssClass="TitleStyle" Text="Missing orders report"></asp:Label>
            <br /><br />
            <table cellpadding="3" cellspacing="3">
            <tr>
            <td style="vertical-align:top;">
                <asp:RadioButtonList ID="DatesLimitRBL" runat="server" AutoPostBack="true"
                    OnSelectedIndexChanged="DatesChanged" CssClass="InerTextStyle">
                <asp:ListItem Text="No dates limit" Value="0" Selected="True"></asp:ListItem>
                <asp:ListItem Text="Limit work order dates:" Value="1"></asp:ListItem>
            </asp:RadioButtonList>
            <asp:Panel ID="DatesPanel" runat="server" Visible="false">
                <asp:DropDownList runat="server" ID="DateTypeDDL" >
                    <asp:ListItem Text="<%$Dict:clientAddWo.SendDate %>" Value="1" Selected="True"></asp:ListItem>
                    <asp:ListItem Text="<%$Dict:clientAddWo.RequestedDelivaryDate %>" Value="2"></asp:ListItem>
                    <asp:ListItem Text="<%$Dict:clientAddWo.PlannedDelivaryDate %>" Value="3"></asp:ListItem>                        
                    <asp:ListItem Text="<%$Dict:clientAddWo.ActualDelivaryDate %>" Value="4"></asp:ListItem>                                         
                </asp:DropDownList>
                <br /><br />
                <asp:Label ID="DateFromTitleLabel" runat="server" Text='<%$Dict:reportsParams.Between %>'></asp:Label>
                <br />
                <KBMControls:KBMReadOnlyTxtBox runat="server" ID="txtFromDate"></KBMControls:KBMReadOnlyTxtBox>
                <KBMValidators:requiredValidator ID="RequiredValidator1" runat="server" ControlToValidate="txtFromDate" ErrorMessage='<%$Dict:reportsParams.MustChooseBetweenTime %>'>
                </KBMValidators:requiredValidator>
                <KBMControls:KbmCalendar TargetControlID="txtFromDate" runat="server" ID="KbmCalendar1">
                </KBMControls:KbmCalendar>
                <br />
                <asp:Label ID="DateTillTitleLabel"  runat="server"  Text='<%$Dict:reportsParams.And %>'></asp:Label>
                <br />
                <KBMControls:KBMReadOnlyTxtBox runat="server" ID="txtToDate"></KBMControls:KBMReadOnlyTxtBox>
                <KBMValidators:requiredValidator ID="RequiredValidator2" ControlToValidate="txtToDate" ErrorMessage='<%$Dict:reportsParams.MustChooseToDate %>'
                    runat="server"></KBMValidators:requiredValidator>
                <KBMControls:KbmCalendar TargetControlID="txtToDate" runat="server" ID="Calendar1">
                </KBMControls:KbmCalendar>
            </asp:Panel>
            </td>
            <td style="vertical-align:top;">
                <table cellpadding="3" cellspacing="3">
                <tr>
                <td>
                    <asp:Label ID="ContractorWONTitleLabel" runat="server" CssClass="InerTextStyle" Text="Specify contractor work order number: "></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="ContractorWONTextBox" runat="server" MaxLength="50" Width="100"></asp:TextBox>
                </td>
                </tr>
                <tr>
                <td>
                    <asp:Label ID="CustomerWONTitleLabel" runat="server" CssClass="InerTextStyle" Text="Specify customer work order number: "></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="CustomerWONTextBox" runat="server" MaxLength="50" Width="100"></asp:TextBox>
                </td>
                </tr>                
                </table>
            </td>
            </tr>
            </table>
            <br />
            <asp:Button ID="GenerateReportButton" runat="server" Text="Generate report" OnClick="ReloadReport" />
            <div style="height:20px;">
                <asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server">
                    <ProgressTemplate>
                        <div class="InerTextStyle">Loading...</div>
                    </ProgressTemplate>
                </asp:UpdateProgress>
            </div>
            <br /><hr /><br />
            <asp:ImageButton ID="ExportImageButton" runat="server" ImageUrl="~/Images/excel.gif"
                 OnClick="ExportToExcel" ToolTip="Export to csv file" />
            <asp:GridView ID="ReportGridview" runat="server" AutoGenerateColumns="false" AllowPaging="false"
                DataSourceID="ReportDataSource" >
             <HeaderStyle BackColor="#86C2FF" />
             <RowStyle CssClass="InerTextStyle" />
             <Columns>
                <asp:BoundField DataField="Quantity" HeaderText="Quantity" />
                <asp:BoundField DataField="originalQuantity" HeaderText="Original quantity" />
                <asp:BoundField DataField="ContractorOrganizationName" HeaderText="Contractor"  />
                <asp:BoundField DataField="CustomerOrganizationName" HeaderText="Customer" />
                <asp:BoundField DataField="CustomerWorkOrderNumber" HeaderText="Customer work order number" />
                <asp:BoundField DataField="ContractorWorkOrderNumber" HeaderText="Contractor work order number" />
                <asp:BoundField DataField="ContractorLotNumber" HeaderText="Supplier lot number" />
                <asp:BoundField DataField="SendDate" HeaderText="Send Date" />
                <asp:BoundField DataField="RequestedDelivaryDate" HeaderText="Requested delivery date" />
                <asp:BoundField DataField="PlannedDelivaryDate" HeaderText="Planned delivery date" />
                <asp:BoundField DataField="CustomerPriority" HeaderText="Priority" />                
                <asp:BoundField DataField="CustomerCatalougeCode" HeaderText="Customer Catalouge Code" />
                <asp:BoundField DataField="ContractorCatalogueCode" HeaderText="Contractor catalogue code" />
                <asp:BoundField DataField="ProductDescription" HeaderText="Product description" />
                <asp:BoundField DataField="Remarks" HeaderText="Remarks" />
                <asp:BoundField DataField="OrderNumber" HeaderText="Order number" />
                <asp:BoundField DataField="SplitId" HeaderText="Split Id" />
            </Columns>
            <EmptyDataTemplate>
               <div class="InerTextStyle">No items matching the request detected</div>
            </EmptyDataTemplate>
            </asp:GridView>
            <asp:SqlDataSource ID="ReportDataSource" runat="server" SelectCommandType="StoredProcedure"
             ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" 
             SelectCommand="SCCover_Reports_MissingOrders"></asp:SqlDataSource> 
        </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
